#ifndef __GZ_INTERFACE_SERVICE_CLIENT_H__
#define __GZ_INTERFACE_SERVICE_CLIENT_H__

#include <string>
#include <functional>

namespace Gazella {

//response
typedef std::function<void(bool, const std::string&)> service_response_callback_t;

class GzServiceClient {
public:
    GzServiceClient();
    ~GzServiceClient();

    //async call service
    static int service_request (
        const std::string& service_name, //service  name to request
        const std::string& if_name,  //interface name to request
        const std::string& request_payload, //service request payload
        service_response_callback_t callback, //service response callback

        uint32_t timeout = 3, //service request timeout, default 3s

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //sync call service
    static std::string service_request (
        const std::string& service_name,
        const std::string& if_name,
        const std::string& request_payload,

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );
};
} //namespace Gazella

#endif